package cn.com.open.itembank.service;

import cn.com.open.itembank.dto.ReturnModel;
import cn.com.open.itembank.dto.RuleInputModel;
import cn.com.open.itembank.dto.RulesSearchModel;

import java.io.UnsupportedEncodingException;

/**
 * 策略接口
 */
public interface RulesService {

    /**
     * 获取策略列表
     *
     * @param appKey     appkey
     * @param rulesModel 策略查询模型
     * @return the return model
     */
    ReturnModel getRulesList(String appKey, RulesSearchModel rulesModel);

    /**
     * 策略删除
     *
     * @param appKey     appkey
     * @param itemBankId 题库id
     * @param id         策略id
     * @return the return model
     */
    ReturnModel removeRules(String appKey, String itemBankId, String id);

    /**
     * 修改策略状态
     *
     * @param appKey     appkey
     * @param itemBankId 题库id
     * @param id         策略id
     * @return the return model
     */
    ReturnModel updateRulesStatus(String appKey, String itemBankId, String id);

    /**
     * 添加策略
     *
     * @param appKey            appkey
     * @param itemBankId        题库id
     * @param ruleInputModel    策略输入模型ruleInputModel
     * @return the return model
     */
    ReturnModel addRule(String appKey, String itemBankId, RuleInputModel ruleInputModel);

    /**
     * 修改策略
     *
     * @param appKey            appkey
     * @param itemBankId        题库id
     * @param ruleInputModel    策略输入模型ruleInputModel
     * @return the return model
     */
    ReturnModel updateRule(String appKey, String itemBankId, RuleInputModel ruleInputModel);

    /**
     * 获取策略信息
     *
     * @param appKey            appkey
     * @param itemBankId        题库id
     * @param ruleID            策略ruleID
     * @return the return model
     */
    ReturnModel getRuleInfo(String appKey, String itemBankId, String ruleID);

    /**
     * 同步组卷
     *
     * @param appKey            appkey
     * @param itemBankId        题库id
     * @param ruleID            策略ruleID
     * @param paperCount       试卷数量
     * @param paperName        试卷名称
     * @return the return model
     */
    ReturnModel createTestPaper(String appKey, String itemBankId, String ruleID, int paperCount, String paperName);

    /**
     * 异步组卷
     *
     * @param appKey            appkey
     * @param itemBankId        题库id
     * @param ruleID            策略ruleID
     * @param paperCount       试卷数量
     * @param paperName        试卷名称
     * @param backUrl          回调路径
     * @return the return model
     */
    ReturnModel asyncGenerateCreateTestPaper(String appKey, String itemBankId, String ruleID, int paperCount, String paperName, String backUrl) throws UnsupportedEncodingException;
}
